import Request from '@/request'

export const getOrder = <T extends object, R>(
  data?: T
): Promise<IResponse<IList<R>>> => {
  return Request.get('/orders/list', data)
}

export const getOrderDetail = <T extends object, R>(
  data: T
): Promise<IResponse<R>> => {
  return Request.get('/orders/list', data)
}

export const addOrder = <T extends object, R>(
  data: T
): Promise<IResponse<R>> => {
  return Request.post('/orders/add', data)
}

export const userOrderStats = <T extends object, R>(
  data: T
): Promise<IResponse<R>> => {
  return Request.get('/orders/stats', data)
}

export const updateOrder = <T extends object, R>(
  data: T
): Promise<IResponse<R>> => {
  return Request.post('/orders/edit', data)
}
